﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PubSubLite.Messaging
{
    /// <summary>
    /// The command dispatcher is responsible for forwarding received messages
    /// to the subscribers.
    /// </summary>
    public interface ICommandDispatcher
    {
        /// <summary>
        /// When a return message is received from the channel, this method will
        /// forward the message to the publisher.
        /// </summary>
        /// <param name="message"></param>
        /// <param name="messageDataType"></param>
        void DispatchReturnMessage(IMessageBase message, Type messageDataType);
        /// <summary>
        /// When a command message is received from the channel, this method
        /// will forward the message to the command subscriber.
        /// </summary>
        /// <param name="message"></param>
        /// <param name="commandDataType"></param>
        void DispatchCommand(IMessageBase message, Type commandDataType);
    }
}
